<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY copy "&#169;">
  <!ENTITY nbsp "&#160;">
  <!ENTITY laquo "&#171;">
  <!ENTITY raquo "&#187;">
]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">


  <xsl:include href="../layout.xsl"/>

  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="content">
    <script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript" src="/js/tiny_mce/tiny_config.js"></script>

    <script type="text/javascript" src="/js/tiny_mce/plugins/imagemanager/js/mcimagemanager.js"></script>
    <script type="text/javascript" src="/js/tiny_mce/i_config.js"></script>

    <div class="contenthead">
      <xsl:call-template name="Create_Path"/>
      <div class="top">
        <span class="title">
          Добавить страницу
        </span>

      </div>
    </div>




    <xsl:call-template name="Lang"/>

    <!--Main Form -->
    <form action="" method="post" name="form" id="form" enctype="multipart/form-data">
      <div class="aside">
        <div class="head-slide on">
          Настройки
        </div>
        <div class="container">
          <fieldset>
            <ul class="editlist">
              <li>
                <label>Атрибуты:</label>

                <ul>
                  <li>
                    <input type="checkbox" name="is_active" value="1">
                      <xsl:if test="$Form/is_active = 1">
                        <xsl:attribute name="checked">checked</xsl:attribute>
                      </xsl:if>
                    </input> Активная категория
                  </li>
                </ul>
              </li>

              <li>
                <label>Тип данных в категории</label>
                <xsl:text> </xsl:text>
                <select name="id_type" id="id_type">
                  <xsl:for-each select="$Form/id_type/row">
                    <option value="{id}">
                      <xsl:if test="@active">
                        <xsl:attribute name="selected">selected</xsl:attribute>
                      </xsl:if>
                      <xsl:value-of select="name" />
                    </option>
                  </xsl:for-each>
                </select>
              </li>

              <li>
                <label>Тип Меню</label>
                <xsl:text> </xsl:text>
                <select name="id_menu" id="id_menu">
                  <option value="0">Это не меню</option>
                  <xsl:for-each select="$Form/id_menu/row">
                    <option value="{id}">
                      <xsl:if test="@active">
                        <xsl:attribute name="selected">selected</xsl:attribute>
                      </xsl:if>
                      <xsl:value-of select="name" />
                    </option>
                  </xsl:for-each>
                </select>
              </li>
            </ul>
          </fieldset>
        </div>
      </div>



      <div class="article">
        <xsl:if test="Main/form/@sent = 1">

          <xsl:if test="Main/form/@error = 1">
            <xsl:attribute name="class">massage_no</xsl:attribute>
          </xsl:if>
          <xsl:if test="Main/form/@error = 0">
            <xsl:attribute name="class">massage_yes</xsl:attribute>
          </xsl:if>
          <xsl:value-of select="Main/form/@message" />

        </xsl:if>



        <!-- Русский -->
        <div id="page_1" style="display: block">
          <fieldset>
            <ul class="editlist">
              <li>
                <label>Название в Меню</label>

                <input name="menu_name_ru" type="text" value="{Main/form/menu_name_ru}" class="broad100"/>
              </li>
            </ul>
          </fieldset>
        </div>

        <!-- Украинский -->
        <div id="page_2" style="display: none">
          <fieldset>
            <ul class="editlist">
              <li>
                <label>Название в Меню</label>

                <input name="menu_name_ua" type="text" id="title" value="{Main/form/menu_name_ua}" class="broad100"/>
              </li>
            </ul>
          </fieldset>
        </div>

        <!-- Английский -->
        <div id="page_3" style="display: none">
          <fieldset>
            <ul class="editlist">
              <li>
                <label>Название в Меню</label>

                <input name="menu_name_en" type="text" id="title" value="{Main/form/menu_name_en}" class="broad100"/>

              </li>
            </ul>
          </fieldset>
        </div>

        <fieldset>
          <ul class="editlist">
            <li>
              <label>Controller</label>

              <input name="_controller" type="text" value="{Main/form/controller}" class="broad100"/>

            </li>



            <li>
              <label>Тип добавления</label>

              <select name="type">
                <xsl:for-each select="Main/form/type/row">
                  <option value="{id}">
                    <xsl:if test="@active">
                      <xsl:attribute name="selected">selected</xsl:attribute>
                    </xsl:if>
                    <xsl:value-of select="name" />
                  </option>
                </xsl:for-each>
              </select>

            </li>

          </ul>
        </fieldset>

      </div>
      <div class="submitbox">
        <input name="save" type="submit" style="font-weight: bold;" value="Сохранить" />
        <input name="saveexit" type="submit" value="Сохранить и выйти" />
        <input type="button" value="Отменить" onclick="document.location = '/{$Controller}#{$Main/@id}'"/>
      </div>
    </form>
  </xsl:template>

</xsl:stylesheet>